//指定中文输出编码
phantom.outputEncoding="GBK";

var casper = require('casper').create();

casper.start('http://cn.bing.com/',function(){
	//获取内容
	var content = this.fetchText('#scpl0');
	this.echo(content);
	//获取属性
	var attribute = this.getElementAttribute('#scpl0','href');
	this.echo(attribute);
});

casper.run();